home *** CD-ROM | disk | FTP | other *** search
Wrap
global gShowPhotoHiliteText, gFileNameList, gBackButtonHandler, gColorBlack, gGraphicHiliteColor, gSearchHiliteColor, gMyScrollObj, gNeedToCallSearch, gSearchChapterOnly, gGlossScrollObj, gFirstTimeInHandBook, gSearchTextSpriteNum, gSearchTextCastNum, gReturnFromHelpFromHandBookText, gTextFileNameIndex, gNeedToDisposeScroll, gColorOfLastFind, gGlosBoxUpTime, gLastSearchKey, gLastSearchLoc, gSearchKeyChanged on startMovie initForEachMovie(#HANDBOOK) if the machineType >= 256 then set gSearchTextSpriteNum to 45 set gSearchTextCastNum to 93 else set gSearchTextSpriteNum to 44 set gSearchTextCastNum to 9 end if creategFileNameList() setMarkerList() initTypeAheadIndexes() set gShowPhotoHiliteText to the text of cast "showPhotoText" set gBackButtonHandler to "returnFromText" set gSearchChapterOnly to 1 set gNeedToDisposeScroll to EMPTY preLoadRange(44, 45, 1) set the textHeight of member 19 to 14 set the textHeight of member 56 to 15 set the text of cast "displayText" to "dummy" set gGlosBoxUpTime to 0 end on stopMovie if not voidp(gMyScrollObj) and objectp(gMyScrollObj) then disposeScroll(gMyScrollObj) set gMyScrollObj to EMPTY end if if not voidp(gGlossScrollObj) and objectp(gGlossScrollObj) then disposeScroll(gGlossScrollObj) set gGlossScrollObj to EMPTY end if end on creategFileNameList if not voidp(gFileNameList) then exit end if set gFileNameList to list("camera handling.txt", "shooting tips.txt", "exposure.txt", "lenses.txt", "the camera.txt", "the way we see.txt", "using light.txt", "action.txt", "aerial.txt", "architecture.txt", "fashion.txt", "landscapes.txt", "portraits.txt", "reportage.txt", "still life.txt", "the studio.txt", "underwater.txt", "wildlife.txt", "editing.txt", "equipment checklist.txt", "legal matters.txt", "the professional.txt", "author.txt") end on returnFromText puppetSprite(2, 0) puppetSprite(7, 0) puppetSprite(8, 0) puppetSprite(11, 0) puppetSprite(9, 0) puppetSprite(gSearchTextSpriteNum, 0) puppetSprite(35, 0) puppetSprite(12, 0) puppetSprite(13, 0) set gNeedToDisposeScroll to gMyScrollObj set the visible of sprite 11 to 1 set the visible of sprite 10 to 1 play frame "start" end on handBookScrollCallBack put getCurrentPage(gMyScrollObj) into word 2 of field 52 end on doSearchMouseUp set the mouseUpScript to EMPTY dontPassEvent() set the castNum of sprite 35 to the castNum of sprite 35 - 1 updateStage() doSearch() end on doSearch if the editable of member gSearchTextCastNum = 0 then set the editable of member gSearchTextCastNum to 1 set the text of cast gSearchTextCastNum to EMPTY exit end if set key to the text of cast gSearchTextCastNum if (key = EMPTY) or (key = " ") then exit end if set textCastNum to the castNum of sprite 2 repeat while 1 if (gLastSearchKey = key) and (gSearchKeyChanged = 0) then set foundLoc to offset(key, char gLastSearchLoc + length(key) to length(the text of cast textCastNum) of the text of cast textCastNum) if foundLoc then set foundLoc to foundLoc + gLastSearchLoc + length(key) - 1 end if else set foundLoc to offset(key, the text of cast textCastNum) end if if foundLoc then if (gLastSearchKey <> EMPTY) and (gLastSearchLoc <> 0) then set the foreColor of char gLastSearchLoc to gLastSearchLoc + length(gLastSearchKey) - 1 of member textCastNum to gColorOfLastFind end if set gColorOfLastFind to the foreColor of char foundLoc of member textCastNum set gLastSearchLoc to foundLoc set charPos to charPosToLoc(member textCastNum, foundLoc) set locOffset to getAt(charPos, 2) - the scrollTop of member textCastNum set fontHeight to linePosToLocV(member textCastNum, 2) if (locOffset > 0) and (locOffset > the height of sprite 2) then doScroll(gMyScrollObj, (locOffset / fontHeight) - 2, 0) else if locOffset <= 0 then if getAt(charPos, 2) < the height of sprite 2 then resetScroll(gMyScrollObj, textCastNum) else doScroll(gMyScrollObj, (locOffset / fontHeight) - 2, 0) end if end if end if updateThumb(gMyScrollObj) if gNeedToCallSearch then set the visible of sprite 2 to 1 cursor(-1) end if set gLastSearchKey to key set endChar to foundLoc + length(key) - 1 repeat with ix = 1 to 2 startTimer() set the foreColor of char foundLoc to endChar of member textCastNum to gSearchHiliteColor repeat while the timer < 5 end repeat startTimer() set the foreColor of char foundLoc to endChar of member textCastNum to gColorBlack repeat while the timer < 5 end repeat end repeat set the foreColor of char foundLoc to endChar of member textCastNum to gSearchHiliteColor exit repeat next repeat end if if searchEntireHandbook() then set foundOne to 0 set thisTextFileIndex to gTextFileNameIndex set the editableText of sprite gSearchTextSpriteNum to 0 cursor(4) set the editableText of sprite gSearchTextSpriteNum to 1 repeat while 1 set thisTextFileIndex to thisTextFileIndex + 1 if thisTextFileIndex > count(gFileNameList) then set thisTextFileIndex to 1 end if if thisTextFileIndex = gTextFileNameIndex then if (gLastSearchKey = key) and (gSearchKeyChanged = 0) then else set gSearchKeyChanged to 0 cursor(-1) beep(1) exit end if end if set fileName to getAt(gFileNameList, thisTextFileIndex) set the text of cast 47 to the text of cast fileName set foundOne to offset(key, the text of cast 47) if foundOne then exit repeat end if end repeat if foundOne then if gLastSearchLoc <> 0 then set the foreColor of char gLastSearchLoc to gLastSearchLoc + length(gLastSearchKey) - 1 of member textCastNum to gColorBlack end if if thisTextFileIndex <> gTextFileNameIndex then set gNeedToDisposeScroll to gMyScrollObj set gMyScrollObj to EMPTY set gTextFileNameIndex to thisTextFileIndex set the visible of sprite 2 to 0 activateText() set gNeedToCallSearch to 1 set gSearchKeyChanged to 1 set gLastSearchLoc to 0 go("text") exit else set gSearchKeyChanged to 1 set gLastSearchLoc to 0 end if end if cursor(-1) next repeat end if if (gLastSearchKey = key) and (gSearchKeyChanged = 0) then if (gLastSearchKey <> EMPTY) and (gLastSearchLoc <> 0) then set the foreColor of char gLastSearchLoc to gLastSearchLoc + length(gLastSearchKey) - 1 of member textCastNum to gColorBlack end if set gSearchKeyChanged to 1 set gLastSearchLoc to 0 next repeat end if beep(1) exit repeat end repeat set gSearchKeyChanged to 0 end on doSearchMouseDown set the castNum of sprite 35 to the castNum of sprite 35 + 1 updateStage() set the mouseUpScript to "doSearchMouseUp" end on searchEntireHandbook return gSearchChapterOnly = 0 end on newWordSelected glossaryIndex set theCastNum to the number of member line glossaryIndex of the text of cast "Glossary List" repeat with boldLength = 1 to the number of chars in the text of cast theCastNum if (the textStyle of char boldLength of member theCastNum contains "bold") = 0 then exit repeat end if end repeat set boldLength to boldLength - 1 repeat while 1 set ch to char boldLength of the text of cast theCastNum if (ch <> " ") and (ch <> "-") then exit repeat end if set boldLength to boldLength - 1 end repeat set textStart to boldLength + 1 repeat while 1 set ch to char textStart of the text of cast theCastNum if (ch <> " ") and (ch <> "-") then exit repeat end if set textStart to textStart + 1 end repeat set the textStyle of member 56 to "plain" set the text of cast 56 to char textStart to length(the text of cast theCastNum) of the text of cast theCastNum set the text of cast 51 to char 1 to boldLength of the text of cast theCastNum showHideGlossaryBox(1) cursor(-1) end on showHideGlossaryBox showHide if showHide = 1 then set the mouseDownScript to "glossaryMouseDown" else end if puppetSprite(40, showHide) if (showHide = 1) and (the machineType >= 256) then set the locV of sprite 40 to the locV of sprite 40 + 6 updateStage() end if set the visible of sprite 33 to showHide set the visible of sprite 39 to showHide set the visible of sprite 40 to showHide if showHide = 1 then set gGlosBoxUpTime to the ticks end if end on glossaryMouseDown set the mouseUpScript to "blockMouseUp" if the ticks > (gGlosBoxUpTime + 15) then set the mouseDownScript to EMPTY dontPassEvent() showHideGlossaryBox(0) end if dontPassEvent() end on blockMouseUp set the mouseUpScript to EMPTY dontPassEvent() end on handBookPart if marker(0) = label("text") then return 2 else return 1 end if end on createGlossaryMarkerList set glosListCastNum to the number of member "Glossary List" set nWords to the number of lines in the text of cast glosListCastNum set nFiles to count(gFileNameList) repeat with file = 1 to nFiles set thisFileList to EMPTY set textCastNum to the number of member getAt(gFileNameList, file) set numWordsFound to 0 repeat with ix = 1 to nWords set thisWord to line ix of the text of cast glosListCastNum case thisWord of "Abstract": next repeat "Action": next repeat "Accessories": next repeat "Aerial photography": next repeat "Architecture": next repeat "Archaeology": next repeat "ASA": next repeat "Balance": next repeat "Bibliography": next repeat "Black-and-white": next repeat "Blur": next repeat "Cleaning": next repeat "Close-up": next repeat "DIN": next repeat "Editing": next repeat "Fashion": next repeat "Flash": next repeat "Flat": next repeat "Focus": next repeat "ISO": next repeat "Landscape": next repeat "LED": next repeat "Lenses": next repeat "Mountains": next repeat "Mode": next repeat "Portraits": next repeat "Rainforest": next repeat "Repro": next repeat "Shading": next repeat "Standard": next repeat "Speed": next repeat "Wildlife photography": next repeat otherwise: end case set ofst to offset(thisWord, the text of cast textCastNum) if ofst then set the textStyle of char ofst to ofst + length(thisWord) - 1 of member textCastNum to "underline" end if end repeat end repeat end on doPrintMouseUp set the mouseUpScript to EMPTY dontPassEvent() set the castNum of sprite 13 to the castNum of sprite 13 - 1 updateStage() if register(xtra("PrintOMatic"), "PMAT130-055-01161") <> 1 then exit end if cursor(4) set doc to new(xtra("PrintOMatic")) if not objectp(doc) then exit end if setDocumentName(doc, the text of cast the castNum of sprite 7) setTextFont(doc, the textFont of member 13) setTextJust(doc, "left") set pageHeight to getPageHeight(doc) set pageWidth to getPageWidth(doc) set footerLocV to pageHeight - 26 setTextSize(doc, 10) set footerString to the text of member "printFooter" repeat with ix = 1 to the number of lines in footerString set lineLocV to footerLocV + (10 * (ix - 1)) drawText(doc, line ix of footerString, point(0, lineLocV)) end repeat newPage(doc) newFrame(doc, rect(0, 0, pageWidth, footerLocV - 24), 0) set headerString to the text of cast "printHeader" & the text of cast the castNum of sprite 7 & RETURN & RETURN setTextSize(doc, 18) append(doc, headerString, 1) if the machineType >= 256 then setTextSize(doc, 12) else setTextSize(doc, 10) end if append(doc, member 13, 1) cursor(-1) updateStage() if doJobSetup(doc) then print(doc) end if set doc to 0 end on goToChapter clickSprite, dotheUnderline set gTextFileNameIndex to clickSprite - 10 + 1 if dotheUnderline then doUnderline(clickSprite, 34, 1) end if cursor(4) startTimer() puppetSprite(2, 1) puppetSprite(7, 1) activateText() puppetSprite(8, 0) puppetSprite(34, 0) prepForTextSection() if dotheUnderline then repeat while the timer < 60 updateStage() end repeat end if if the locH of sprite 2 > 2000 then set the locH of sprite 2 to the locH of sprite 2 - 2000 end if set the castNum of sprite 7 to 70 + (gTextFileNameIndex - 1) set the locH of sprite 7 to the locH of sprite 2 - 6 play frame "text" end on prepForTextSection set gLastSearchKey to EMPTY set the text of cast gSearchTextCastNum to " " if the machineType >= 256 then set the textFont of member gSearchTextCastNum to "MS Sans Serif" else set the textFont of member gSearchTextCastNum to "Monaco" end if set the textSize of member gSearchTextCastNum to 9 set gLastSearchLoc to 0 set gSearchKeyChanged to 1 set the editable of member gSearchTextCastNum to 0 end on enableEditing puppetSprite(44, 1) set the ink of sprite 44 to 0 updateStage() if (the editable of member gSearchTextCastNum = 0) and (gNeedToCallSearch = 0) then set the editable of member gSearchTextCastNum to 1 set the text of cast gSearchTextCastNum to EMPTY end if end